package com.atguigu.tingshu.order.rpc;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.order.OrderInfo;
import com.atguigu.tingshu.order.service.OrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author：yyj
 * @Package：com.atguigu.tingshu.order.rpc
 * @Project：tingshu_parent240829
 * @name：OrderInfoApiController
 * @Date：2025/2/13 20:46
 * @Filename：OrderInfoApiController
 */
@RestController
@RequestMapping("/api/inner/orderinfo")
public class OrderInfoRpcController {
    @Autowired
    private OrderInfoService orderInfoService;

    @GetMapping("/getOrderInfoByOrderNo/{orderNo}")
    Result<OrderInfo> getOrderInfoByOrderNo(@PathVariable(value = "orderNo") String orderNo) {
        OrderInfo orderInfoAndDetail = orderInfoService.getOrderInfoAndDetail(orderNo);
        return Result.ok(orderInfoAndDetail);
    }
}